<%@ page pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='xzsp' /></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <form name="totalForm" id="totalForm" method="get">

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='spmc' /></label>
                        <div class="layui-input-inline">
                            <input type="text" name="name" placeholder="<fmt:message key='qsrspmc' />" value="<c:if test='${params.name !=null}'>${params.name}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='spbh' /></label>
                        <div class="layui-input-inline">
                            <input type="text" name="goodsNo" placeholder="<fmt:message key='qsrspmc' />" value="<c:if test='${params.goodsNo !=null}'>${params.goodsNo}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-sm layuiadmin-btn-list" id="search"><fmt:message key='ss' /></button>
                    </div>
                </form>
            </div>
        </div>

    </div>

    <div class="layui-card">
        <div class="layui-field-box layui-form">

            <table class="layui-table" lay-size="sm">
                <thead>
                <tr>
                    <th width="5%"><input id="checkboxs" type="checkbox" lay-ignore lay-skin="primary"/></th>
                    <th><fmt:message key='xh' /></th>
                    <th><fmt:message key='spbh' /></th>
                    <th width="30%"><fmt:message key='spmc' /></th>
                    <th><fmt:message key='spfm' /></th>
                    <th><fmt:message key='spfl' /></th>
                    <th><fmt:message key='spje' /></th>
                    <th><fmt:message key='zkc' /></th>
                    <th><fmt:message key='tjsj' /></th>
                    <th><fmt:message key='zt' /></th>
                </tr>
                </thead>
                <c:forEach items="${page.result}" var="item" varStatus="status">
                    <tr>
                        <td><input type="checkbox" lay-ignore data-id="${item.id}" value="${item.id}" data-name="${item.name}" class="feijin-check" lay-skin="primary"/></td>
                        <td>${status.index + 1}</td>
                        <td>${item.goodsNo}</td>
                        <td>${item.name}</td>
                        <td><img style="width:40px;height:40px;" class="preview" src="${store_domain}/uploads/${item.defaultImage}"/></td>
                        <td>${item.goodsChannel.name}</td>
                        <td><fmt:formatNumber value="${item.defaultPrice}" type="CURRENCY"/></td>
                        <td>${item.store}</td>
                        <td><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        <td>
                            <c:choose>
                                <c:when test="${item.status eq 1}"><fmt:message key='dsj' /></c:when>
                                <c:when test="${item.status eq 2}"><fmt:message key='shz' /></c:when>
                                <c:when test="${item.status eq 3}"><fmt:message key='xsz' /></c:when>
                                <c:when test="${item.status eq 4}"><fmt:message key='shbtg' /></c:when>
                                <c:when test="${item.status eq 5}"><fmt:message key='yxj' /></c:when>
                                <c:when test="${item.status eq 6}"><fmt:message key='ysq' /></c:when>
                            </c:choose>
                        </td>
                    </tr>
                </c:forEach>
            </table>
            <jsp:include page="/commons/page.jsp" flush="true"/>
        </div>
    </div>

</div>

<script>
    layui.use(["form"], function () {

        var form = layui.form;

        //全选反选
        $("#checkboxs").click(function () {
            if (this.checked) {
                $(".feijin-check:checkbox").prop("checked", true);
            } else {
                $(".feijin-check:checkbox").prop("checked", false);
            }
        });

    });
</script>
</body>
</fmt:bundle>
</html>
